A dialog hook function handles user selections in a dialog box.
A dialog hook function should have the following form:
FUNCTION MyDlgHook (item: Integer; theDialog: DialogPtr;
myDataPtr: Ptr): Integer;
You supply a dialog hook function to handle user selections of items that you added to a dialog box. If you provide a dialog hook function, CustomPutFile and CustomGetFile call your function immediately after calling ModalDialog . They pass your function the item number returned by ModalDialog , a pointer to the dialog record, and a pointer to the data received from your application, if any.
Your dialog hook function returns as its function result an integer that is either the item number passed to it or some other item number. If your dialog hook function does not handle a selection, it should pass the item number back to the Standard File Package for processing by setting its return value equal to the item number. If your dialog hook function does handle the selection, it should pass back sfHookNullEvent or the number of some other pseudo-item.
See "Writing a Dialog Hook Function" for a sample dialog hook function.